<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="css/style.css">
  <style>
    #instance3 {
      width: 360px;
      height: 200px;
      position: fixed;
      top: 20px;
      left: 20px;
    }

    #instance3 .demo {
      width: 100%;
      height: 100%;
      margin: 0 0 20px 0;
    }
  </style>
</head>
<body>
<div id="instance1">
  <div class="demo"></div>
  <div class="btn-box">
    <button class="btn btn-primary" type="button" data-open>
      open
    </button>
    <button class="btn btn-danger" type="button" data-pause>
      pause
    </button>
  </div>
</div>

<div id="instance2">
  <div class="demo"></div>
  <div class="btn-box">
    <button class="btn btn-primary" type="button" data-open>
      open
    </button>
    <button class="btn btn-danger" type="button" data-pause>
      pause
    </button>
  </div>
</div>

<div id="instance3">
  <div class="demo"></div>
  <div class="btn-box">
    <button class="btn btn-primary" type="button" data-open>
      open
    </button>
    <button class="btn btn-danger" type="button" data-pause>
      pause
    </button>
  </div>
</div>

<div id="instance4">
  <div class="demo"></div>
  <div class="btn-box">
    <button class="btn btn-primary" type="button" data-open>
      open
    </button>
    <button class="btn btn-danger" type="button" data-pause>
      pause
    </button>
  </div>
</div>

<script src="js/event.js"></script>
<script>
  // 普通测试
  bind('#instance1', function() {
    return new JParticles.Particle('#instance1 .demo', {
      num: 100,
    })
  })

  // 无线段测试
  bind('#instance2', function() {
    return new JParticles.Particle('#instance2 .demo', {
      // range为0，不连接线
      range: 0,
      num: 10,
      maxR: 20,
      minR: 10,
      maxSpeed: 6,
    })
  })

  // 固定定位测试
  bind('#instance3', function() {
    return new JParticles.Particle('#instance3 .demo', {
      range: 50,
      proximity: 40,
    })
  })

  // 超过首屏及 lineShape API 测试
  bind('#instance4', function() {
    return new JParticles.Particle('#instance4 .demo', {
      lineShape: 'cube',
    })
  })
</script>
</body>
</html>
